$(function(){
   $('#tm3').click(function(){showCalendar('tm3','tm4','chgdate')});
   $('#tm4').click(function(){showCalendar('tm4','','chgdate');});
});

function chgdate() {
	var tm3 = $("#tm3").val();
	var tm4 = $("#tm4").val();
	var url = "";
	if(iswrite==1) {
		url = siteurl+"hotel/"+hotelid+"_"+tm3+"_"+tm4+"."+fileex;
	} else {
		url = siteurl+"index.php?ac=hotel&at=hotelshow&hid="+hotelid+"&tm1="+tm3+"&tm2="+tm4;
	}
	window.location.href = url;
	//$.ajax({
	//   url: siteurl+"/index.php",
	//   data: "ac=hotel&at=changedate&tm1="+tm3+"&tm2="+tm4+"&ran="+Math.random(),
	//   success: function(data){
	//	  window.location.reload();
	//   }
	//});
}